package com.firebird.app.fejpsl.ui.activity.sword

import android.content.Intent
import android.os.Bundle
import android.view.View
import com.firebird.app.fejpsl.R
import com.firebird.app.fejpsl.base.BaseTbActivity
import com.firebird.app.fejpsl.ui.activity.sword.top.EvaluationTopActivity
import com.firebird.app.fejpsl.ui.activity.sword.top.FanTopActivity
import com.firebird.app.fejpsl.ui.activity.sword.top.PassThroughTopActivity
import com.firebird.app.fejpsl.ui.activity.sword.top.RandTopActivity
import kotlinx.android.synthetic.main.layout_toolbar.*

class SwordTopActivity  : BaseTbActivity() {

    fun click(v: View?) {
        when (v?.id) {
            R.id.mEvaluationTop-> {
                Intent(this, EvaluationTopActivity::class.java).run {
                    startActivity(this)
                }
            }
            R.id.mRandTop ->{
                val intent = Intent(this, RandTopActivity().javaClass)
                startActivity(intent)
            }
            R.id.mPassThroughTop-> {
                val intent = Intent(this, PassThroughTopActivity().javaClass)
                startActivity(intent)
            }
            R.id.mFanTop-> {
                Intent(this, FanTopActivity::class.java).run {
                    startActivity(this)
                }
            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.sword_top)
        val drawable = resources.getDrawable(R.drawable.back)
        drawable.setBounds(0, 0, 120, 120)
        tv_back.setCompoundDrawables(drawable, null, null, null)
        setBack()
        val titleName = this.resources.getText(R.string.top_kind) as String
        setTitle(titleName)
    }

}
